…24608)
# Backport
This will backport the following commits from `main` to `8.19`:
- [[Discover][APM] Detect OTEL spans for doc viewer
(#224439)](#224439)
<!--- Backport version: 9.6.6 -->
### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)
<!--BACKPORT [{"author":{"name":"Gonçalo Rica Pais da
Silva","email":"goncalo.rica@elastic.co"},"sourceCommit":{"committedDate":"2025-06-19T16:01:54Z","message":"[Discover][APM]
Detect OTEL spans for doc viewer (#224439)\n\n## Summary\n\nThis PR
modifies the Span doc viewer check to be better equipped for\ndealing
with unprocessed OTEL trace spans. If there is no\n`processed.event`
field, we can start assuming there'd be OTEL specific\nfields to check.
Here, we check for `kind` which *should* be present, so\nany value
determines this to be a trace span. In the absence of `kind`\nbeing
present and no `processed.event` field (just a
`data_stream.type`\nfield, we can assume it is a span
regardless.\n\n\n## How to test\n\n* Add the following to your
`kibana.dev.yml`
file:\n```yaml\ndiscover.experimental.enabledProfiles:\n -
observability-traces-data-source-profile\n -
observability-traces-transaction-document-profile\n -
observability-traces-span-document-profile\n```\n* Set up a source of
unprocessed OTEL data to feed into ES (Open\ntelemetry demo, etc)\n* Set
your space to Observability mode, and go to Discover.\n* Query for
`traces-*` and open any record for the document viewer\n* The Span
Overview tab should be
visible.","sha":"c88328f2902564dfd283690ecfe9ed6384901837","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:obs-ux-infra_services","backport:version","v9.1.0","v8.19.0"],"title":"[Discover][APM]
Detect OTEL spans for doc
viewer","number":224439,"url":"https://github.com/elastic/kibana/pull/224439","mergeCommit":{"message":"[Discover][APM]
Detect OTEL spans for doc viewer (#224439)\n\n## Summary\n\nThis PR
modifies the Span doc viewer check to be better equipped for\ndealing
with unprocessed OTEL trace spans. If there is no\n`processed.event`
field, we can start assuming there'd be OTEL specific\nfields to check.
Here, we check for `kind` which *should* be present, so\nany value
determines this to be a trace span. In the absence of `kind`\nbeing
present and no `processed.event` field (just a
`data_stream.type`\nfield, we can assume it is a span
regardless.\n\n\n## How to test\n\n* Add the following to your
`kibana.dev.yml`
file:\n```yaml\ndiscover.experimental.enabledProfiles:\n -
observability-traces-data-source-profile\n -
observability-traces-transaction-document-profile\n -
observability-traces-span-document-profile\n```\n* Set up a source of
unprocessed OTEL data to feed into ES (Open\ntelemetry demo, etc)\n* Set
your space to Observability mode, and go to Discover.\n* Query for
`traces-*` and open any record for the document viewer\n* The Span
Overview tab should be
visible.","sha":"c88328f2902564dfd283690ecfe9ed6384901837"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.19"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/224439","number":224439,"mergeCommit":{"message":"[Discover][APM]
Detect OTEL spans for doc viewer (#224439)\n\n## Summary\n\nThis PR
modifies the Span doc viewer check to be better equipped for\ndealing
with unprocessed OTEL trace spans. If there is no\n`processed.event`
field, we can start assuming there'd be OTEL specific\nfields to check.
Here, we check for `kind` which *should* be present, so\nany value
determines this to be a trace span. In the absence of `kind`\nbeing
present and no `processed.event` field (just a
`data_stream.type`\nfield, we can assume it is a span
regardless.\n\n\n## How to test\n\n* Add the following to your
`kibana.dev.yml`
file:\n```yaml\ndiscover.experimental.enabledProfiles:\n -
observability-traces-data-source-profile\n -
observability-traces-transaction-document-profile\n -
observability-traces-span-document-profile\n```\n* Set up a source of
unprocessed OTEL data to feed into ES (Open\ntelemetry demo, etc)\n* Set
your space to Observability mode, and go to Discover.\n* Query for
`traces-*` and open any record for the document viewer\n* The Span
Overview tab should be
visible.","sha":"c88328f2902564dfd283690ecfe9ed6384901837"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
Co-authored-by: Gonçalo Rica Pais da Silva <goncalo.rica@elastic.co>
Summary
This PR modifies the Span doc viewer check to be better equipped for dealing with unprocessed OTEL trace spans. If there is no
processed.eventfield, we can start assuming there'd be OTEL specific fields to check. Here, we check forkindwhich should be present, so any value determines this to be a trace span. In the absence ofkindbeing present and noprocessed.eventfield (just adata_stream.typefield, we can assume it is a span regardless.Related to #221521
How to test
kibana.dev.ymlfile:traces-*and open any record for the document viewer